import classroom.*;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public class Main {
    public static void main(String[] args) {
        People mbg = new Teacher(69, "马保国",
                "年轻人不讲武德", "捂着红肿的眼睛",
                "武德");
        People yc = new Teacher(19, "杨晨",
                "我女妆真好看", "露出开心的笑容",
                "女妆的一百零八种技巧");
        People zk = new Student(21, "郑开",
                "杨晨学姐太强了", "拍了拍杨晨");
        People robot = new People(0, "1024", "你们肯定猜不到我是机器人", "喝了一口机油") {
            @Override
            protected String words() {
                return words;
            }

            @Override
            protected String action() {
                return name + "机器人" + action + "。";
            }

            @Override
            public void answerQuestion(String answer) {
                System.out.println("A--Robot " + name + " :");
                if (answer == null) {
                    System.err.println("机器故障：NullPointerException");
                    return;
                }
                System.out.println("答案是：" + answer);
            }

            @Override
            public void askQuestion(Answerable answerable, String question) {
                System.out.println("Q--Robot " + name + " :");
                question = "你知道我的名字吗?";
                System.out.println("问你个问题：" + question);
                answerable.answerQuestion(Classroom.getAnswer(question));
            }
        };
        List<People> peoples = new ArrayList<>();
        peoples.add(mbg);
        peoples.add(yc);
        peoples.add(zk);
        peoples.add(robot);
        for (People people : peoples) {
            people.doSomething();
        }
        Classroom classroom = new Classroom("twt");
        classroom.addPeople(peoples);
        classroom.discuss();
    }
}
